package com.zhihesj.anan.system.service.impl;

import com.zhihesj.anan.system.entity.Role;
import com.zhihesj.anan.system.entity.RoleDept;
import com.zhihesj.anan.system.entity.RoleMenu;
import com.zhihesj.anan.system.entity.UserRole;
import com.zhihesj.anan.system.mapper.RoleMapper;
import com.zhihesj.anan.system.service.RoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 角色信息表 服务实现类
 * </p>
 *
 * @author anan
 * @since 2020-07-22
 */
@Service
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {

    @Autowired
    private RoleMapper roleMapper;

    @Override
    public List<Role> getRolesByUserid(Long userId) {
        return roleMapper.getRolesByUserid(userId);
    }

    @Override
    public List<RoleMenu> getMenuList(Long roleId) {
        return roleMapper.getMenuList(roleId);
    }

    @Override
    public List<UserRole> getUserList(Long roleId) {
        return roleMapper.getUserList(roleId);
    }

    @Override
    public List<RoleDept> getDeptList(Long roleId) {
        return roleMapper.getDeptList(roleId);
    }

    @Override
    public List<Role> getRolesByIdentifier(String identifier) {
        return roleMapper.getRolesByIdentifier(identifier);
    }
}
